<template>
	<view class="badge" :class="{more99:count>maxCount,more10:count>9}">
		{{count > maxCount ? (maxCount+'+'): count}}
	</view>
</template>

<script>
	export default {
		name: "hs-badge",
		props: {
			count: {
				type: Number || String,
				default: 0
			},
			maxCount: {
				type: Number || String,
				default: 99
			}
		},
		data() {
			return {

			};
		}
	}
</script>

<style lang="scss" scoped>
	.badge {
		height: 25rpx;
		width: 25rpx;
		background: #FF0000;
		color: #fff;
		border-radius: 12.5rpx;
		line-height: 25rpx;
		text-align: center;
		font-size: 22rpx;
		&.more10 {
			width: 40rpx;
		}

		&.more99 {
			width: 50rpx;
		}
	}
</style>